package com.vf.admin.utils.saishi;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.vf.admin.utils.httpqingqiu.HttpPostUtils;

import java.util.List;
import java.util.Map;

public class Demo {
    //获取比赛信息api
    //https://www.qttzb.com/api-pro/about    2e2b8374327f20f8543ad258ffe0c067


    public static void main(String[] args) {
        try {
            //String ace = "token=2e2b8374327f20f8543ad258ffe0c067&number=10&pn=1&status=playing";
            String ace = "token=2e2b8374327f20f8543ad258ffe0c067&number=100&pn=1&order=asc";
            String result = HttpPostUtils.getInstance().sendGets("https://www.qttzb.com/api-pro/about",ace);
            System.out.println(result);


            List<QiuSaiDto> list = JSONObject.parseArray(result, QiuSaiDto.class);
            for (QiuSaiDto stu : list) {
                System.out.println(stu.getHome_name());
                //System.out.println(stu.getStreams().get(0));
//                for (Streams streams : stu.getStreams()){
//                    System.out.println(streams.getKbps());
//                }
                System.out.println("———————————————————————————————————————");
            }

            JSONArray listArray=JSONArray.parseArray(JSON.toJSONString(list));
            System.out.println("listArray:"+listArray.toString());
        } catch (Exception e){
           e.printStackTrace();
           System.out.println("x");
        }
    }


}
